package com.mayi.zds.dao;

import com.mayi.zds.entity.OrderItem;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName OrderItemDAO
 * @Description TODO
 * @Author zhong
 * @Date 2019/12/24 0024 下午 4:19
 * @Version 1.0
 */
@Repository
public interface OrderItemDAO {
    /**
     * 增加订单项
     * @Author zhong
     * @Date 2019/12/24 16:40:12
     * @param orderItem
     * @return void
     **/
    @Insert("insert into zds_orderitem values(#{id},#{orderId},#{goodsId},#{price},#{nums})")
    public void add(OrderItem orderItem);

    /**
     * 根据订单ID获取订单详细列表
     * @Author zhong
     * @Date 2019/12/04 20:43:59
     * @param oid 订单ID
     * @return java.util.List<com.zhong.myshop.entity.OrderDetail>
     **/
    @Select("select * from zds_orderitem where order_id=#{oid}")
    public List<OrderItem> getListByOrderId(String oid);
}
